#include <iostream>
#define N 100

using namespace std;

int isprime(int n){
int i;
for (i=2; i<n/2; i++)
    if (n%i==0)
        return 0;
return 1;
}

int isFibonacci(int n){
	int i;
	int fibonacci[50];
	if(n==0 || n==1)
		return 1;
	fibonacci[0]=0;
	fibonacci[1]=1;
	for(i=2;i<50;i++){
		fibonacci[i]= fibonacci[i-1] + fibonacci[i-2];
		if(n==fibonacci[i])
			return 1;}
return 0;
}

int no_ofFibonacciprimes(int array[], int elements){
	int i, no=0;
	for(i=0;i<elements;i++)
		if (isFibonacci(array[i]) && isprime(array[i]))
			++no;
return no;
}

void readintVector(int array[], int elements){
for (int i=0; i<elements; i++){
	cout<<"a["<<i<<"]=";
	cin>>array[i];
	cout<<"\n";}
}

void printintVector(int array[], int elements){
for(int i=0; i<elements; i++){
	cout<<array[i]<<" ";}
	cout<<"\n";
}

int main(){
int array[N];
int elements;
int answer;
cout<<"Type the number of elements you want in the array: ";
cin>>elements;

readintVector(array, elements);

cout<<"The original array is ";
for(int i=0; i<elements; i++){
	cout<<array[i]<<" ";}
cout<<endl;

answer=no_ofFibonacciprimes(array, elements);
cout<< answer<<" numbers are prime and in the Fibbonacci sequence.";
return 0;

}
